POV-Ray : Newsgroups : povray.binaries.images : Fill any object with dense-packed spheres of any radius (16kbbu) : Re: Fill any object with dense-packed spheres of any radius (16kbbu) Server Time
19 Aug 2024 06:17:50 EDT (-0400)
  Re: Fill any object with dense-packed spheres of any radius (16kbbu)  
From: Greg M  Johnson
Date: 31 Dec 2000 09:09:37
Message: <3a4f3e21@news.povray.org>
ian mcdonald wrote:

> I never got it to work. I never came close. I don't even know where to start
> beyond needing an intersection testing algorhythm.

You don't need that. The object function does the trick, plus knowing how the
face centered cubic structure is stacked...

Here is the core of my algo:

   #declare obfun=pigment {object {MyObject color Black color White}}
                #local dd=array[5]
                #local drr=(2^0.5)*radii;
                #local dd[1]=<0,0,0>;
                #local dd[2]=<0,drr,drr>;
                #local dd[3]=<drr,0,drr>;
                #local dd[4]=<drr,drr,0>;

    #local place=dd[nnnn]+<minx+ix*dx,miny+iy*dy,minz+iz*dz>;
    #local blank=eval_pigment(obfun,place);

    #if (blank.x>0)
               sphere {place,radii*1}
    #end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.